package com.floreantpos.model.dao;

import java.util.Date;
import java.util.List;

import org.hibernate.criterion.Restrictions;

import com.floreantpos.model.StoreRest;
import com.floreantpos.model.dao.BaseStoreRestDAO;
import com.floreantpos.util.Util;


public class StoreRestDAO extends BaseStoreRestDAO implements com.floreantpos.model.dao.iface.StoreRestDAO {

	public StoreRestDAO () {}

	public List<StoreRest> findAllByToday() {
		return createNewSession()
				.createCriteria(StoreRest.class)
				.add(Restrictions.le(
						StoreRest.PROP_MODIFIED_TIME,
						Util.parseDateTime(Util.formatDate(new Date())
								+ " 23:59:59")))
				.add(Restrictions.ge(
						StoreRest.PROP_MODIFIED_TIME,
						Util.parseDateTime(Util.formatDate(new Date())
								+ " 00:00:00"))).list();
	}
}